package com.cskaoyan.dbutils.resultSetHandler;

import com.cskaoyan.datasource.DruidUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.ColumnListHandler;

import javax.management.Query;
import java.sql.SQLException;
import java.util.List;

/**
 * 创建日期: 2022/07/02 11:19
 *
 * @author ciggar
 */
public class ColumnListHandlerDemo {

    public static void main(String[] args) throws SQLException {

        QueryRunner queryRunner = new QueryRunner(DruidUtils.getDataSource());

        List<Object> nameList = queryRunner.query("select name from account", new ColumnListHandler<>());

        System.out.println(nameList);

    }
}
